<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<button>
  后盾人
</button>
<script>
  function show() {
    console.log(this.name);
  }

  show.call({name: 'zhangsan'})
  // 区别： call会立即执行函数，bind不会执行，需要在进行手动的执行函数才可以
  show.bind({name: 'tom'})()

  let a = function () {

  }
  let b = a;
  console.log(a instanceof Object)
  console.log(b === a)
  b = a.bind()
  console.log(a === b)

  //  bind 会返回一个新的函数


  function hd(a, b) {
    return this.f + a + b
  }

  // let func = hd.bind({f: 1});
  // console.log(func(3, 4))

  document.querySelector("button").addEventListener("click", function (event) {
    document.write(this.url + event.target.innerHTML)
  }.bind({url: 'houdunren.com'}))


</script>
</body>
</html>